package phoneinfo;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.hadoop.io.Writable;
//创建一个自定义的类实现writable接口

//统计第一季度手机用户的上网总流量，通话时间，短信数/
public class PhoneNum implements Writable{

	private int internate;
	private int calltime;
	private int mailcount;
	public PhoneNum(){
		//添加一个无参的构造函数
	}
	public PhoneNum(int internate, int calltime, int mailcount) {
		super();
		this.internate = internate;
		this.calltime = calltime;
		this.mailcount = mailcount;
	}
	public int getInternate() {
		return internate;
	}
	public void setInternate(int internate) {
		this.internate = internate;
	}
	public int getCalltime() {
		return calltime;
	}
	public void setCalltime(int calltime) {
		this.calltime = calltime;
	}
	public int getMailcount() {
		return mailcount;
	}
	public void setMailcount(int mailcount) {
		this.mailcount = mailcount;
	}
	@Override
	public void readFields(DataInput in) throws IOException {
		// TODO Auto-generated method stub
		this.internate=in.readInt();
		this.calltime=in.readInt();
		this.mailcount=in.readInt();
	}
	@Override
	public void write(DataOutput out) throws IOException {
		// TODO Auto-generated method stub
		out.writeInt(internate);
		out.writeInt(calltime);
		out.writeInt(mailcount);
	}
	@Override
	public String toString() {
		return internate + "\t" + calltime+ "\t" + mailcount;
	}
	
}
